auto_ptr is a class template available in the C++Standard Library (declared in the header file) that provides some basic RAII features for C++ raw pointers. The auto_ptr template class describes an object that stores a pointer to a single allocated object that ensures that the object to which it points gets destroyed automatically when control leaves a scope.〔(【引用サイトリンク】publisher=Microsoft )〕 The C++11 standard made auto_ptr deprecated, replacing it with the unique_ptr class template. The shared_ptr template class defined in C++11, and available in the Boost library, can be used as an alternative to auto_ptr or unique_ptr for collections with ownership semantics. ==Declaration== The auto_ptr class is declared in ISO/IEC 14882, section 20.4.5 as: